<form action="predeposit.manage.php" method="post" id="form1" name="form1">
<input type="hidden" name="action" id="action" value="artificial_operation_save" />
<table width="680" class="from_table">
  
  <tr>
  <th width="207"><tpl> $langPreSearchMemberName </tpl>：</th>
	  <td width="234" align="left"><input type="text" class="txtinput" name="member_name" id="member_name" /></td>
	  <td width="223"><span class="btn_left">
      <input type="button" name="search_member" id="search_member" value="<tpl> $langPreSearch </tpl>" class="btn_submit" /></span></td>
    </tr>
</table>
<div id="member_info"></div>
</form>
<script>
$(document).ready(function() {	
	//验证
	var options = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ST(1,1);
								ShowDiv = 'result_content';
								getPageContent('predeposit.manage.php?action=predeposit_detail_list');
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txt_system_remark: {required:true},
			txt_available_amount: {required:true,number:true},
			txt_freeze_amount: {required:true,number:true},
			txt_close_remark: {required:true}
		},
		messages: {
			txt_system_remark: {required:"<tpl> $langPreMemberChangeReasonIsEmpty </tpl>"},
			txt_available_amount: {required:"<tpl> $langPreAvailableIsNumber </tpl>",number:"<tpl> $langPreAvailableIsNumber </tpl>"},
			txt_freeze_amount: {required:"<tpl> $langPreFreezeIsNumber </tpl>",number:"<tpl> $langPreFreezeIsNumber </tpl>"},
			txt_close_remark: {required:"<tpl> $langPreCloseIsEmpty </tpl>"}
		},
		submitHandler: function() {
			$('#form1').ajaxSubmit(options);
		}
	});
	
	//查找会员信息
	$("#search_member").click(function(){
		if($('#member_name').val() != ''){
			ajax_search_member();
		}else{
			alert('<tpl> $langPreMemberNameIsEmpty </tpl>');
		}
	});
});	


//查找会员信息
function ajax_search_member(){
	$.ajax({
		url: "predeposit.manage.php",
		<tpl> if $NCharset eq 'UTF-8' </tpl>
		data: 'action=search_member&member_name='+$('#member_name').val(),
		<tpl> else </tpl>
		data: 'action=search_member&member_name='+escape($('#member_name').val()),
		<tpl> /if </tpl>
		type:'post',
		dataType:"html",
		beforeSubmit:  showLoading(showText),
		success: function(msg){
			hideLoading();
			$('#member_info').html(msg);
		}
	});
	return false;
}
</script>